var $ = require("../../utils/Ajax.js");
Page({
  data: {
    Index: 0,
    CouponNav:["未使用","已使用/已过期"],
    Coupon: null
  },

  onLoad: function (options) {
    var that = this;
    $.Ajax("api/userCoupon","GET",{},function(res){
      if(res.s){
        that.setData({
          Coupon: res.d.userCoupon
        })
      }else{
        wx.showToast({
          title: res.m,
          icon: 'none',
          duration: 1500
        })
      }
    })
  },

  onShow: function () {

  },

  // 点击顶部Nav
  CouponNav: function(e){
    var Index = e.currentTarget.dataset.index_;
    this.setData({
      Index: Index
    })
  }
})